package control;


public class GroupControl extends Control{
	protected Control[] controls;
	public GroupControl(int numControl) {
		controls = new Control[numControl];
	}
	public Control get(int i)
	{
		return controls[i];
	}
	public void setControl(int i,Control ctr)
	{
		controls[i] = ctr;
	}
	public boolean pointerPressed(int x,int y)
	{
		for (int i = 0; i < controls.length; i++) {
			Control ctr = controls[i];
			if(ctr.visible())
			{
				ctr.pointerPressed( x, y);
			}
		}
		return false;
	}
	
	public boolean pointerReleased(int x,int y)
	{
		for (int i = 0; i < controls.length; i++) {
			Control ctr = controls[i];
			if(ctr.visible())
			{
				ctr.pointerReleased( x, y);
			}
		}
		return false;
	}
	
}
